package com.hiznu.amap_flutter.map

import android.util.Log
import com.amap.api.maps.model.UrlTileProvider
import java.net.URL

class CustomTileProvider(val tileUrl: String) : UrlTileProvider(256, 256) {
    override fun getTileUrl(x: Int, y: Int, zoom: Int): URL {
        val url = tileUrl.replace("{x}", x.toString())
            .replace("{y}", y.toString())
            .replace("{z}", zoom.toString())

        Log.e("插件", "设置自定义瓦片图层 $url, 原始url $tileUrl")

        return URL(url)
    }
}